package com.wanmait.recruit.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.recruit.mapper.SkillLabelInfoMapper;
import com.wanmait.recruit.pojo.Resume;
import com.wanmait.recruit.pojo.SkillLabel;
import com.wanmait.recruit.pojo.SkillLabelInfo;
import com.wanmait.recruit.service.SkillLabelInfoService;
import com.wanmait.recruit.service.SkillLabelService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageInfo;
import com.wanmait.recruit.service.SkillLabelInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import com.wanmait.recruit.pojo.SkillLabelInfo;
import com.wanmait.recruit.mapper.SkillLabelInfoMapper;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("skillLabelInfoService")
@Transactional(rollbackFor = Exception.class)
public class SkillLabelInfoServiceImpl  implements SkillLabelInfoService {

    @Resource
    SkillLabelInfoMapper skillLabelInfoMapper;


    @Override
    public List<SkillLabel> findByResume(Resume resume) {
        return skillLabelInfoMapper.findByResumeId(resume.getId());
    }

    public int deleteByPrimaryKey(Integer id){
        return skillLabelInfoMapper.deleteByPrimaryKey(id);
    }

    public void insert(SkillLabelInfo record){
        skillLabelInfoMapper.insert(record);
    }

    @Override
    public void delete(SkillLabelInfo object) {

    }

    @Override
    public void update(SkillLabelInfo object) {

    }

    @Override
    public PageInfo<SkillLabelInfo> search(int pageNum, int pageSize) {
        return null;
    }

    public int insertSelective(SkillLabelInfo record){
        return skillLabelInfoMapper.insertSelective(record);
    }

    public SkillLabelInfo selectByPrimaryKey(Integer id){
        return null;
    }

    public int updateByPrimaryKeySelective(SkillLabelInfo record){
        return skillLabelInfoMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(SkillLabelInfo record){
        return skillLabelInfoMapper.updateByPrimaryKey(record);
    }

    @Override
    public boolean findIsSkillLabelInfo(Integer resumeId) {
        List<SkillLabelInfo> skillLabelInfos = skillLabelInfoMapper.selectByPrimaryKey(resumeId);
        if (skillLabelInfos.size()==0){
            return false;
        }else {
            return true;
        }
    }

    @Override
    public ArrayList<SkillLabelInfo> findSkillLabelInfo(Integer resumeId) {
        return skillLabelInfoMapper.selectByPrimaryKey(resumeId);
    }

    @Override
    public void deleteById(Integer id) {
        skillLabelInfoMapper.deleteById(id);
    }

    @Override
    public void deleteByResumeId(Integer resumeId) {
        skillLabelInfoMapper.deleteByResumeId(resumeId);
    }



}
